import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '@/views/Login.vue'


Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login',
    component:Login
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/views/layout/layout.vue'),
    children:[
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/HomeView.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
